package com.maxus.mini.ecard.entity.ecard;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.maxus.mini.common.VersionedAuditableIdEntity;
import com.maxus.mini.ecard.entity.user.User;

/**
 * 电子贺卡
 * 
 * @author wujinsong
 *
 */
@Entity
@Table(name = "ecard_ecard")
public class ECard extends VersionedAuditableIdEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Override
	public Long getId() {
		return id;
	}

	/***
	 * 标题
	 */
	private String title;

	/**
	 * 副标题
	 */
	private String subTitle;

	/**
	 * 内容
	 */
	private String content;

	/**
	 * 多少人使用过
	 */
	private int used;

	/**
	 * 本地图片url
	 */
	private String picUrl;

	/**
	 * 服务端图片地址
	 */
	private String serverPicUrl;

	/**
	 * 点赞数
	 */
	private int likeCount;

	/**
	 * 用户
	 */
	private User user;

	/**
	 * 是否模板
	 */
	private boolean isTemplate;

	/**
	 * 是否热门
	 */
	private boolean isHot;

	/**
	 * 父贺卡
	 */
	private ECard parent;

	/**
	 * 文件名称
	 */
	private String fileName;

	/**
	 * 文件类型
	 */
	private String fileType;

	/**
	 * 颜色
	 */
	private String color;

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSubTitle() {
		return subTitle;
	}

	public void setSubTitle(String subTitle) {
		this.subTitle = subTitle;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public int getUsed() {
		return used;
	}

	public void setUsed(int used) {
		this.used = used;
	}

	public String getPicUrl() {
		return picUrl;
	}

	public void setPicUrl(String picUrl) {
		this.picUrl = picUrl;
	}

	public String getServerPicUrl() {
		return serverPicUrl;
	}

	public void setServerPicUrl(String serverPicUrl) {
		this.serverPicUrl = serverPicUrl;
	}

	public int getLikeCount() {
		return likeCount;
	}

	public void setLikeCount(int likeCount) {
		this.likeCount = likeCount;
	}

	@ManyToOne()
	@JoinColumn(name = "user_id")
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public boolean isTemplate() {
		return isTemplate;
	}

	public void setTemplate(boolean isTemplate) {
		this.isTemplate = isTemplate;
	}

	public boolean isHot() {
		return isHot;
	}

	public void setHot(boolean isHot) {
		this.isHot = isHot;
	}

	@ManyToOne()
	@JoinColumn(name = "parent_id")
	public ECard getParent() {
		return parent;
	}

	public void setParent(ECard parent) {
		this.parent = parent;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getFileType() {
		return fileType;
	}

	public void setFileType(String fileType) {
		this.fileType = fileType;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}
}
